#!/usr/bin/env bash

omni_cli_sh='docker exec omnicored-test omnicore-cli -conf=/root/.bitcoin/bitcoin.conf -testnet '

# 查看默认地址
def_addr=`${omni_cli_sh} listaccounts ""`
echo "查看默认账户地址————>" ${def_addr}

btc_balance=`${omni_cli_sh} getbalance `
echo "btc余额————>" ${btc_balance}

omni_balance=`${omni_cli_sh} omni_getbalance  ${def_addr} 2`
echo "omni余额————>" ${omni_balance}

echo "换取omni币————>"
${omni_cli_sh} sendtoaddress "moneyqMan7uh8FqdCA2BV5yZ8qVrc9ikLP" 0.1
# TX -- 73601f61d1d0bd90c933af6ed08db2110e3e1d2247c5d2298678487570ecebec

echo "转账TOMNI————>" 
${omni_cli_sh} omni_send mtZNG3Jg1EZd58dEzYbSnwLrWNpt1pzw5e mgdnvyKY3o3M2qvyi25DDkqL9k7Gtv1oZP 2 1.0

$omni_cli_sh sendtoaddress